import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../layout/index'
import login from '@/views/login'
import home from '@/views/home'
import list from '@/views/list/index'
import system from '@/views/system/index'
import comment from '@/views/comment/index'

export function constantRouterMap() {
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/home',
      component: Layout,
      hidden: true,
      children: [
        {
          path: '',
          component: home,
          name: '首页',
          meta: { title: '首页' }
        }
      ]
    },
    {
      path: '/list',
      component: Layout,
      hidden: true,
      children: [
        {
          path: '',
          component: list,
          name: '图书列表',
          meta: { title: '图书列表' }
        }
      ]
    },
    {
      path: '/system',
      component: Layout,
      hidden: true,
      children: [
        {
          path: '',
          component: system,
          name: '管理',
          meta: { title: '管理' }
        }
      ]
    },
    {
      path: '/comment',
      component: Layout,
      hidden: true,
      children: [
        {
          path: '',
          component: comment,
          name: '用户评价过的图书',
          meta: { title: '用户评价过的图书' }
        }
      ]
    }
  ]
})
